---
title: Using kubectl to Create a Deployment
---

<!DOCTYPE html>

<html lang="en">

<body>

<link href="/docs/tutorials/kubernetes-basics/public/css/styles.css" rel="stylesheet">

<div class="layout" id="top">

    <main class="content">

        <div class="row">

         <div class="col-md-8">
          <h3>Objectives</h3>
                <ul>
                    <li>Learn about application Deployments.</li>
                    <li>Deploy your first app on Kubernetes with kubectl.</li>
                </ul>
            </div>

            <div class="col-md-8">
                <h3>Kubernetes Deployments</h3>
                <p>
                Once you have a running Kubernetes cluster, you can deploy your containerized applications on top of it.
                To do so, you create a Kubernetes <b>Deployment</b> configuration. The Deployment instructs Kubernetes
                how to create and update instances of your application. Once you've created a Deployment, the Kubernetes
                master schedules mentioned application instances onto individual Nodes in the cluster.
                </p>

                <p>Once the application instances are created, a Kubernetes Deployment Controller continuously monitors those instances. If the Node hosting an instance goes down or is deleted, the Deployment controller replaces it. <b>This provides a self-healing mechanism to address machine failure or maintenance.</b></p>

                <p>In a pre-orchestration world, installation scripts would often be used to start applications, but they did not allow recovery from machine failure.  By both creating your application instances and keeping them running across Nodes, Kubernetes Deployments provide a fundamentally different approach to application management. </p>

            </div>

            <div class="col-md-4">
                <div class="content__box content__box_lined">
                    <h3>Summary:</h3>
                    <ul>
                        <li>Deployments</li>
                        <li>Kubectl</li>
                    </ul>
                </div>
                <div class="content__box content__box_fill">
                    <p><i>
                        A Deployment is responsible for creating and updating instances of your application
                    </i></p>
                </div>
            </div>
        </div>
        <br>

        <div class="row">
            <div class="col-md-8">
                <h2 style="color: #3771e3;">Deploying your first app on Kubernetes</h2>
            </div>
        </div>

        <div class="row">
            <div class="col-md-8">
                <p><img src="/docs/tutorials/kubernetes-basics/public/images/module_02_first_app.svg"></p>
            </div>
        </div>
        <br>

        <div class="row">
            <div class="col-md-8">

                <p>You can create and manage a Deployment by using the Kubernetes command line interface, <b>Kubectl</b>. Kubectl uses the Kubernetes API to interact with the cluster. In this module, you'll learn the most common Kubectl commands needed to create Deployments that run your applications on a Kubernetes cluster.</p>

                <p>When you create a Deployment, you'll need to specify the container image for your application and the number of replicas that you want to run. You can change that information later by updating your Deployment; Modules <a href="/docs/tutorials/kubernetes-basics/scale-intro/">5</a> and <a href="/docs/tutorials/kubernetes-basics/update-intro/">6</a> of the bootcamp discuss how you can scale and update your Deployments.</p>




            </div>
            <div class="col-md-4">
                <div class="content__box content__box_fill">
                    <p><i> Applications need to be packaged into one of the supported container formats in order to be deployed on Kubernetes </i></p>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-md-8">
                <p>For our first Deployment, we'll use a <a href="https://nodejs.org">Node.js</a> application packaged in a Docker container. The source code and the Dockerfile are available in the <a href="https://github.com/kubernetes/kubernetes-bootcamp">GitHub repository</a> for the Kubernetes Bootcamp.</p>

                <p>Now that you know what Deployments are, let's go to the online tutorial and deploy our first app!</p>

            </div>
        </div>
        <br>

        <div class="row">
            <div class="col-md-12">
                <a class="btn btn-lg btn-success" href="/docs/tutorials/kubernetes-basics/deploy-interactive/" role="button">Start Interactive Tutorial <span class="btn__next">›</span></a>
            </div>
        </div>

    </main>

</div>

</body>
</html>
